import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
    {
        path: '/home',
        name: 'Home',
        component: () => import('../views/home.vue'),
        children:[
            //二级路由
            // {
            //     path:"/HomeDetail",
            //     component:()=>import('../views/Home-Detail')
            // }
        ]
    },
    {
        path: '/my',
        name: 'My',
        component: () => import('../views/my.vue')
    },
    {
        path: '/member',
        name: 'Member',
        component: () => import('../views/member.vue')
    },
    {
        path: '/news',
        name: 'News',
        component: () => import('../views/news.vue')
    },
    {
        path: '/seach',
        name: 'Seach',
        component: () => import('../views/seach.vue')
    },
    {
        path: '/seach',
        name: 'Seach',
        component: () => import('../views/seach.vue')
    },
    {
        path: '/help',
        name: 'Help',
        component: () => import('../views/Help.vue')
    },
    {
        path:"/HomeDetail",
        name: "HomeDetail",
        component:()=>import('../views/Home-Detail.vue')
    },
    {
        path:"/MyDetail",
        name: "MyDetail",
        component:()=>import('../views/My-index.vue')
    },
    {
        path:"/KaiTong",
        name: "KaiTong",
        component:()=>import('../views/Kaitonghuiyuan.vue')
    },
    {
        path: '/',
        redirect: "/home"
    },
    {
        path: '/*',
        name: 'Error',
        component: () => import('../views/error.vue')
    },
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
